package tpf.designer.pattern.course5.structure_pattern2.flyweight_13.simple;

import org.junit.Test;

public class ClientSingleton {

    private static FlyweightFactorySingleton factorySingleton;

    @Test
    public void testSingleton(){
        factorySingleton = FlyweightFactorySingleton.getInstance();
        Flyweight flyweight = factorySingleton.factory('A');
        flyweight.operation("First Call");

        flyweight = factorySingleton.factory('B');
        flyweight.operation("Second Call");

        flyweight = factorySingleton.factory('A');
        flyweight.operation("Third Call");

        factorySingleton.checkFlyweight();
    }
}
